home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.001 / tcpdump-~ / tcpdump-3.0.2-linux / tcpdump-3.0.2 / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-09-30  |  7.1 KB  |  216 lines

  1. #  Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995
  2. #     The Regents of the University of California.  All rights reserved.
  3. #
  4. #  Redistribution and use in source and binary forms, with or without
  5. #  modification, are permitted provided that: (1) source code distributions
  6. #  retain the above copyright notice and this paragraph in its entirety, (2)
  7. #  distributions including binary code include the above copyright notice and
  8. #  this paragraph in its entirety in the documentation or other materials
  9. #  provided with the distribution, and (3) all advertising materials mentioning
  10. #  features or use of this software display the following acknowledgement:
  11. #  ``This product includes software developed by the University of California,
  12. #  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
  13. #  the University nor the names of its contributors may be used to endorse
  14. #  or promote products derived from this software without specific prior
  15. #  written permission.
  16. #  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17. #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. #
  20. # @(#) $Header: Makefile.in,v 1.152+ 94/06/16 20:55:40 leres Exp $ (LBL)
  21.  
  22. #
  23. # You might want to edit these path names.
  24. #
  25.  
  26. # Full pathname of where to install the binaries
  27. BINDEST = /usr/local/sbin/tcpdump
  28. # Full pathname of where to install the manual entries
  29. MANDEST = /usr/local/man/man1/tcpdump.1
  30.  
  31. #
  32. # You shouldn't need to edit anything below here.
  33. #
  34.  
  35. # Possible Options:
  36. #  -DCSLIP    include support for kernel slip interface
  37. #  -DPPP    include support for point to point protocol
  38. #  -DIBMRTPC    enable the MERIT additions to the Stanford Enetfilter
  39. #  -DDECNETLIB    use the optional DECnet library under Ultrix and others
  40. #  -DNOVFPRINTF    simulate vfprintf() on systems that don't have it
  41. #
  42. # CSLIP and PPP work only under BPF.
  43. #
  44.  
  45. #have-cslip#CSLIP_DEFINES = -DCSLIP
  46. #have-dnet#DNET_DEFINES = -DDECNETLIB
  47. #have-ethers#ETHERS_DEFINES = -DETHER_SERVICE
  48. #have-aix2#OS_DEFINES = -DSVR4
  49. #have-irix5#OS_DEFINES = -DSVR4 -D_BSD_SIGNALS
  50. #have-sunos3#OS_DEFINES = -DSUNOS3
  51. #have-sunos5#OS_DEFINES = -DSOLARIS -DSVR4
  52. #have-linux#OS_DEFINES = -DPPP -DCSLIP
  53.  
  54. # DEFINES per machine vs. os
  55. #have-rt-bsd#MD_OS_DEFINES = -DNOVFPRINTF
  56.  
  57. # cc (i.e. not gcc) dependent flags per machine vs. os
  58. #have-alpha-osf1v1#MD_OS_CFLAGS = -g3
  59. #have-mips-irix4#MD_OS_CFLAGS = -xansi -D__STDC__ -Dinline=
  60. #have-mips-irix5#MD_OS_CFLAGS = -xansi -D__STDC__ -Dinline=
  61. #have-rt-bsd#MD_OS_CFLAGS = -U__STDC__
  62.  
  63. LOCAL_INCLUDES = -I/usr/local/include
  64. #have-gcc#LOCAL_INCLUDES =
  65.  
  66. CCOPT = -O
  67. INCLUDES = -Ilibpcap $(LOCAL_INCLUDES)
  68. #have-linux#INCLUDES = -Ilibpcap -Ilinux-include $(LOCAL_INCLUDES)
  69. OPTIONAL_DEFINES = $(ETHERS_DEFINES) $(DNET_DEFINES) $(OS_DEFINES)
  70. DEFINES = $(CSLIP_DEFINES) -DPPP -DHAVE_FDDI \
  71.     $(MD_OS_DEFINES) $(OPTIONAL_DEFINES)
  72.  
  73. # gcc flags
  74. GCC_PROTO_FLAGS = -Wmissing-prototypes -Wstrict-prototypes
  75. #have-gcc1#GCC_PROTO_FLAGS =
  76.  
  77. # Compiler dependent flags
  78. CC_FLAGS = $(MD_OS_CFLAGS)
  79. #have-gcc#CC_FLAGS = -g -Wall $(GCC_PROTO_FLAGS)
  80.  
  81. # Standard CFLAGS
  82. CFLAGS = $(CCOPT) $(CC_FLAGS) $(DEFINES) $(INCLUDES)
  83.  
  84. # Standard C compiler
  85. CC = cc
  86. #have-gcc#CC = gcc
  87.  
  88. # Optional libraries as available
  89. #have-dnet#DNET_LIBS = -ldnet
  90.  
  91. # Optional libraries per machine vs. os
  92. #have-sun4-sunos5#MD_OS_LIBS = -lsocket -lnsl
  93. #have-alpha-osf1v1#MD_OS_LIBS = /usr/examples/packetfilter/pfopen.c
  94. #have-alpha-osf1v2#MD_OS_LIBS =
  95.  
  96. LOCAL_LIBS = -L/usr/local/lib
  97. #have-gcc#LOCAL_LIBS =
  98.  
  99. # Standard LIBS
  100. LIBS = -Llibpcap $(LOCAL_LIBS) $(DNET_LIBS) $(MD_OS_LIBS) -lpcap
  101.  
  102. # The installed binary is owned by this group.
  103. GROUP = staff
  104. #have-sunos5#GROUP = sys
  105. #have-alpha-osf1v1#GROUP = system
  106. #have-alpha-osf1v2#GROUP = system
  107. #have-alpha-osf1v3#GROUP = system
  108. #have-bpf#GROUP = bpf
  109. #have-linux#GROUP = 0
  110.  
  111. MAKE = make
  112.  
  113. # Explicitly define compiliation rule since SunOS 4's make doesn't like gcc.
  114. # Also, gcc does not remove the .o before forking 'as', which can be a
  115. # problem if you don't own the file but can write to the directory.
  116. .c.o:
  117.     rm -f $@; $(CC) $(CFLAGS) -c $*.c
  118.  
  119. CSRC =    tcpdump.c addrtoname.c \
  120.     print-ether.c print-ip.c print-arp.c print-tcp.c print-udp.c \
  121.     print-atalk.c print-domain.c print-tftp.c print-bootp.c print-nfs.c \
  122.     print-icmp.c print-sl.c print-ppp.c print-rip.c \
  123.     print-snmp.c print-ntp.c print-null.c print-egp.c print-ospf.c \
  124.     print-fddi.c print-llc.c print-sunrpc.c \
  125.     print-wb.c print-decnet.c print-isoclns.c print-ipx.c \
  126.     util.c bpf_dump.c parsenfsfh.c
  127. GEN =    version.c
  128.  
  129. SRC =    $(CSRC) $(GEN)
  130. ALLSRC = \
  131.     $(CSRC)
  132.  
  133. OBJ =    $(SRC:.c=.o)
  134. # Some makes can't handle the above substitution
  135. #have-broken-make#OBJ = tcpdump.o addrtoname.o \
  136. #have-broken-make#    print-ether.o print-ip.o print-arp.o print-tcp.o \
  137. #have-broken-make#    print-udp.o print-atalk.o print-domain.o print-tftp.o \
  138. #have-broken-make#    print-bootp.o print-nfs.o print-icmp.o print-sl.o \
  139. #have-broken-make#    print-ppp.o print-rip.o print-snmp.o print-ntp.o \
  140. #have-broken-make#    print-null.o print-egp.o print-ospf.o print-fddi.o \
  141. #have-broken-make#    print-llc.o print-sunrpc.o print-wb.o print-decnet.o \
  142. #have-broken-make#    print-isoclns.o print-ipx.o util.o \
  143. #have-broken-make#    bpf_dump.o parsenfsfh.o \
  144. #have-broken-make#    version.o
  145.  
  146. HDR =    addrtoname.h appletalk.h bootp.h decnet.h \
  147.     ethertype.h extract.h fddi.h interface.h llc.h mib.h \
  148.     nfsv2.h ntp.h ospf.h nfsfh.h ipx.h
  149. MDHDR =    md-hp300.h md-sun3.h md-sun4.h md-mips.h md-vax.h md-rt.h md-alpha.h \
  150.     md-i386.h
  151. OSHDR =    os-bsd.h os-sunos3.h os-sunos4.h os-sunos5.h os-ultrix4.h os-osf1v1.h \
  152.     os-osf1v2.h os-osf1v3.h os-irix4.h os-irix5.h
  153.  
  154. TAGHDR = \
  155.     /usr/include/netinet/in.h \
  156.     /usr/include/netinet/udp.h \
  157.     /usr/include/netinet/tcp.h \
  158.     /usr/include/arpa/tftp.h \
  159.     /usr/include/netinet/if_ether.h
  160.  
  161. TAGFILES = \
  162.     $(SRC) $(HDR) md.h os.h $(TAGHDR)
  163.  
  164. AWKS =    atime.awk packetdat.awk send-ack.awk stime.awk
  165.  
  166. TARFILES = \
  167.     README CHANGES INSTALL VERSION Makefile.in tcpdump.1 makemib mkdep \
  168.     $(ALLSRC) $(HDR) $(MDHDR) $(OSHDR) \
  169.     $(AWKS) configure
  170.  
  171. tcpdump: $(OBJ)
  172.     $(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
  173.  
  174. version.o: version.c
  175. version.c: VERSION
  176.     rm -f version.c; sed -e 's/.*/char version[] = "&";/' VERSION > $@
  177.  
  178. install: force
  179.     rm -f $(DESTDIR)$(BINDEST) $(DESTDIR)$(MANDEST)
  180.     cp tcpdump $(DESTDIR)$(BINDEST)
  181.     chmod 550 $(DESTDIR)$(BINDEST)
  182.     chgrp $(GROUP) $(DESTDIR)$(BINDEST)
  183.     cp tcpdump.1 $(DESTDIR)$(MANDEST)
  184.  
  185. lint:    $(GEN) force
  186.     lint -hbxn $(SRC) | \
  187.         grep -v 'struct/union .* never defined' | \
  188.         grep -v 'possible pointer alignment problem'
  189.  
  190. clean:
  191.     rm -f $(OBJ) tcpdump $(GEN)
  192.  
  193. realclean:
  194.     rm -f $(OBJ) tcpdump $(GEN) md.h os.h libpcap Makefile tags
  195.  
  196. tags:    $(TAGFILES)
  197.     ctags -wtd $(TAGFILES)
  198.  
  199. tar:    $(GEN) force
  200.     @cwd=`pwd` ; dir=`basename $$cwd` ; name=tcpdump-`cat VERSION` ; \
  201.         list="" ; tar="tar cFFf" ; \
  202.         for i in $(TARFILES) ; do list="$$list $$name/$$i" ; done; \
  203.         echo \
  204.         "rm -f ../$$name; ln -s $$dir ../$$name" ; \
  205.          rm -f ../$$name; ln -s $$dir ../$$name ; \
  206.         echo \
  207.         "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
  208.          (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
  209.         echo \
  210.         "rm -f ../$$name" ; \
  211.          rm -f ../$$name
  212.  
  213. force:    /tmp
  214. depend:    $(GEN) force
  215.     ./mkdep -c $(CC) $(DEFINES) $(INCLUDES) $(SRC)
  216.